package com.yidu.manage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yidu.manage.domain.SysRole;
import com.yidu.manage.mapper.ISysRoleMapper;
import com.yidu.manage.service.ISysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

import static com.yidu.common.domain.BaseEntity.DELETED;

@Service
public class SysRoleServiceImpl implements ISysRoleService
{
    @Autowired
    private ISysRoleMapper sysRoleMapper;

    @Override
    public List<SysRole> findSysRoleList(SysRole sysRole)
    {
        QueryWrapper<SysRole> wrapper = new QueryWrapper<>();
        if (sysRole.getId() != null)
        {
            wrapper.eq("id", sysRole.getId());
        }
        wrapper.eq("deleted", DELETED);
        return sysRoleMapper.selectList(wrapper);
    }
}
